#include<iostream>
#include<string>
#include<cstring>
using namespace std;
int main()
{
	string s;
	cin >> s;
	int boy = 0;
	int girl = 0;
	for (int i = 0; i < s.size(); i++) {
		if (s[i] == 'b') boy++;
		if (s[i] == 'o' && s[i - 1] != 'b') boy++;
		if (s[i] == 'y' && s[i - 1] != 'o') boy++;
		if (s[i] == 'g')girl++;
		if(s[i]=='i'&&s[i-1]!='g')girl++;
		if(s[i]=='r'&&s[i-1]!='i')girl++;
		if(s[i]=='l'&&s[i-1]!='r')girl++;
	}
	cout << boy << endl;
	cout << girl << endl;
	return 0;
}